// @ts-nocheck

// import { wordCloudRequire } from "../../pages/dashboard/components/recommend-components/wordCloud.js";

interface FunctionRequeire {
  option: any;
  render(param?: any): { chartIns, timelineIns?};
  destroy();
}

interface ComponentRequire {
  dataRequire: any;
  functionRequire(inputData: any): FunctionRequeire;
  rules: any;
  stander: string;
  label: string;
  subLabel: string;
  style?: string;
}

interface ComponentConfig {
  handler: ComponentRequire;
  size?: string;
  type: string;
  kline?: boolean;
  fixHeight?: boolean;
}


export const ComponentsMap: { [key: string]: ComponentConfig } = {
  area: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['area'],
    type: 'newCharts'
  },
  bandedIntervalTrendLine: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['bandedIntervalTrendLine'],
    type: 'newCharts'
  },
  bar: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['bar'],
    type: 'newCharts'
  },
  bar3D: {
    // handler: window.AIGCDataVis.F10.componentMap['bar3D'],
    size: 'squar-medium',
    type: 'newCharts'
  },
  donutPie: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['donutPie'],
    type: 'newCharts'
  },
  doubleIndicatorBarAndLine: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['doubleIndicatorBarAndLine'],
    type: 'newCharts'
  },
  doublePie: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['doublePie'],
    type: 'newCharts'
  },
  dynamicBeeSwarm: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicBeeSwarm'],
    type: 'newCharts'
  },
  dynamicBubble: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicBubble'],
    type: 'newCharts'
  },
  dynamicLine: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicLine'],
    type: 'newCharts'
  },
  dynamicRankingHorizontalBar: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicRankingHorizontalBar'],
    type: 'newCharts'
  },
  dynamicRankingLine: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicRankingLine'],
    type: 'newCharts'
  },
  dynamicRankingTwoWayHorizontalBar: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicRankingTwoWayHorizontalBar'],
    type: 'newCharts'
  },
  dynamicVoronoi: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['dynamicVoronoi'],
    type: 'newCharts'
  },
  gauge: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['gauge'],
    type: 'newCharts'
  },
  groupedBar: {
    // handler: window.AIGCDataVis.F10.componentMap['groupedBar'],
    size: 'long-small',
    type: 'newCharts'
  },
  groupedHorizontalBar: {
    // handler: window.AIGCDataVis.F10.componentMap['groupedHorizontalBar'],
    size: 'tall-small',
    type: 'newCharts'
  },
  groupedStackedBar: {
    // handler: window.AIGCDataVis.F10.componentMap['groupedStackedBar'],
    size: 'tall-small',
    type: 'newCharts'
  },
  line: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['line'],
    type: 'newCharts'
  },
  multiDimensionalScatter: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['multiDimensionalScatter'],
    type: 'newCharts'
  },
  multiDimensionalScatter3D: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['multiDimensionalScatter3D'],
    type: 'newCharts'
  },
  multiIndicatorRingGauge: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['multiIndicatorRingGauge'],
    type: 'newCharts'
  },
  multiIndicatorStackedBar: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['multiIndicatorStackedBar'],
    type: 'newCharts'
  },
  multiIndicatorStackedLine: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['multiIndicatorStackedLine'],
    type: 'newCharts'
  },
  multipleLine: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['multipleLine'],
    type: 'newCharts'
  },
  numericText: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['numericText'],
    type: 'newCharts'
  },
  pie: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['pie'],
    type: 'newCharts'
  },
  polarBar: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['polarBar'],
    type: 'newCharts'
  },
  positiveAndNegativeDoubleIndicatorComparisonLine: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['positiveAndNegativeDoubleIndicatorComparisonLine'],
    type: 'newCharts'
  },
  positiveAndNegativeDoubleIndicatorSumBar: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['positiveAndNegativeDoubleIndicatorSumBar'],
    type: 'newCharts'
  },
  proportionalBar: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['proportionalBar'],
    type: 'newCharts'
  },
  radar: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['radar'],
    type: 'newCharts'
  },
  radiusPie: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['radiusPie'],
    type: 'newCharts'
  },
  scatter: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['scatter'],
    type: 'newCharts'
  },
  scatter3D: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['scatter3D'],
    type: 'newCharts'
  },
  stackedArea: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['stackedArea'],
    type: 'newCharts'
  },
  stackedBar: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['stackedBar'],
    type: 'newCharts'
  },
  stackedHorizontalBar: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['stackedHorizontalBar'],
    type: 'newCharts'
  },
  stackedLine: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['stackedLine'],
    type: 'newCharts'
  },
  treeMap: {
    size: 'long-small',
    // handler: window.AIGCDataVis.F10.componentMap['treeMap'],
    type: 'newCharts'
  },
  waterfall: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['waterfall'],
    type: 'newCharts'
  },
  // wordCloud: {
  //   handler: wordCloudRequire,
  //   size: 'squar-medium',
  //   type: 'echarts'
  // },
  summaryText: {
    size: 'squar-small',
    // handler: window.AIGCDataVis.F10.componentMap['summaryText'],
    type: 'newCharts'
  },
  table: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['table'],
    type: 'newCharts'
  },
  timeList: {
    size: 'tall-small',
    // handler: window.AIGCDataVis.F10.componentMap['timeList'],
    type: 'newCharts'
  },
  verticalTable: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['verticalTable'],
    type: 'newCharts'
  },
  hxKLineAndMultiIndicatorLine: {
    size: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['hxKLineAndMultiIndicatorLine'],
    type: 'newCharts'
  }
}

export const LowCode = {
  size: 'squar-medium',
  handler: window['F10/base/thslc-f10-comp-renderer@1.0.11index'],
  type: 'lowcode'
}


interface FixComponent {
  type: string;
  url: string;
  compId: string;
  codeMarket: boolean;
  props: any;
  kline?: boolean;
}
export const FixComponentMap: { [key: string]: FixComponent } = {
  sankeyChart: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-business-sankey-chart.js',
    style: 'squar-medium',
    compId: 'F10/business/finance/thslc-f10-business-sankey-chart@1.1.29index',
    codeMarket: true,
    propsData: {
      options: { code: '300033', market: '33' },
      queryParam: { language: 'zh' },
      periods: [],
      urlOption: '//basic.10jqka.com.cn/fuyao/financial_reports_visual/a/v2/sankey',
      template: 'STOCK',
      lang: 'zh'
    }
  },
  rectTree: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aiclientandsupplies.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aiclientandsupplies@1.0.5index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  newsList: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aievent.js',
    style: 'long-small',
    compId: 'F10/business/event/thslc-f10-aievent@1.0.2index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  productIndustryData: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aiproductrelated.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aiproductrelated@1.0.4index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  companyInfo: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aicompany.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aicompany@1.0.2index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  clientAndSupplies: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aiclientandsupplies.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aiclientandsupplies@1.0.5index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  mainTarget: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aimaintarget.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aimaintarget@1.0.5index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  valuationTrend: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aivaluationtrend.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aivaluationtrend@1.0.4index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  valuationChannel: {
    type: 'Vue',
    url: 'https://s.thsi.cn/cd/website-f10-pluto/v3.0/fix-comp/thslc-f10-aivaluationchannel.js',
    style: 'squar-medium',
    compId: 'F10/business/event/thslc-f10-aivaluationchannel@1.0.4index',
    propsData: {
      options: { code: '300033', market: '33' },
    }
  },
  hxKLine: {
    style: 'squar-medium',
    // handler: window.AIGCDataVis.F10.componentMap['hxKLine'],
    type: 'fixCharts',
    kline: true
  },
}